import 'package:ac/data/ac_device_tool.dart';
import 'package:ac/route/ac_route_pages.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get_navigation/src/root/get_material_app.dart';

import 'data/ac_app_preferences.dart';

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await AcAppPreferences().init();
  await AcDeviceTool.init();
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return ScreenUtilInit(
      designSize: const Size(375, 812),
      builder: (BuildContext context, Widget? child) {
        return GetMaterialApp(
          debugShowCheckedModeBanner: false,
          title: "VolcanoVista",
          getPages: AcRoutePages.routes,
          initialRoute: AcRoutePages.initial,
          builder: EasyLoading.init(),
        );
      },
    );
  }
}
